<div class="pagination justify-content-center">
  <p>
    {% for p in pages %} {% if p == 1 and page == 1 %}
    <span>1</span>
    {% elif p == 1 %}
    <a href="{{ url_for('get_home') }}">{{ p }}</a>
    {% else %} {% if page == p %}
    <span>{{ p }}</span>
    {% else %}
    <a href="{{ url_for('get_blog_page', page=p) }}">{{ p }}</a>
    {% endif %} {% endif %} {% endfor %}
  </p>
</div>
